package cn.asoul.test.infrastructure;

import cn.asoul.infrastructure.persistent.redis.IRedisService;
import cn.asoul.infrastructure.persistent.redis.RedissonService;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.redisson.api.RMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * @description: TODO
 * @author: chen
 * @date: 2025/3/6 2:44
 */
@Slf4j
@SpringBootTest
public class RedisServiceTest {
    @Autowired
    private IRedisService redisService;


    @Test
    public void test() {
        RMap<Object, Object> map = redisService.getMap("strategy_id_100001");
        log.info("map, {}", map);
        map.put(1, 101);
        map.put(2, 102);
        map.put(3, 103);
        map.put(4, 104);
        map.put(5, 101);
        map.put(6, 101);
        map.put(7, 102);
        map.put(8, 101);
        map.put(9, 102);
        log.info("测试结果: {}", redisService.getFromMap("strategy_id_100001", 1).toString());
    }
}
